{#<img src="{{ filepath(course.largePicture, 'course.png')}}" class="img-responsive mask-img">#}
{% if lesson is empty or lesson.startTime is empty or lesson.endTime is empty %}
  <div class="mask">
    <div class="modal-dialog" style="width:200px;margin:22% auto;">
      <div class="modal-content">
        <div class="modal-body clearfix">
          <i class="es-icon es-icon-info" style="font-size: 22px;"></i>
          <span class="media-error">暂未发布直播</span>
        </div>
      </div>
    </div>
  </div>
{% else %}
  {% set refererUrl = app.request.server.get('HTTP_REFERER') %}
  <div class="mask live-header-mask">
  {% if lesson.startTime > ("now"|date("U")) %}
    <div class="mask-content">
      <h2>{{'直播将于'|trans}}<span class="phm">{{ lesson.startTime|date('m') }}{{ '月'|trans }}{{ lesson.startTime|date('d') }}{{ '日'|trans }} {{ lesson.startTime|date('H:i') }}</span>{{'开始'|trans}}</h2>
      
      {% if lesson.startTimeLeft <= 3600 %}
        <a class="btn btn-info btn-lg mask-btn" href="{{ path('live_open_course_play',{courseId:course.id,lessonId:lesson.id})}}" target="_blank">{{'进入直播教室'|trans}}</a>
      {% else %}
        <button id="alerted-btn" class="btn btn-info btn-lg active {% if not member or (member and not member.isNotified ) %}hidden{% endif %}">
          {{'已设置提醒'|trans}}<i class="es-icon es-icon-alarmon"></i>
        </button>

        {% if setting('cloud_sms.sms_enabled') and (setting('cloud_sms.sms_live_play_one_day') == 'on' or setting('cloud_sms.sms_live_play_one_hour') == 'on') %}
          {% if app.request.get('as')|default('') == 'preview' %}
            <a href="javascript:;" class="btn btn-info btn-lg mask-btn" disabled="disabled">
              {{'提醒我参加'|trans}}<i class="es-icon es-icon-alarmon"></i>
            </a>
          {% else %}
            <a id="alert-btn" class="btn btn-info btn-lg mask-btn {% if member and member.isNotified %}hidden{% endif %}" 
              data-url="{{ path('open_course_member_sms',{id:course.id}) }}" data-toggle="modal" data-target="#modal" >
              {{'提醒我参加'|trans}}<i class="es-icon es-icon-alarmon"></i>
            </a>
          {% endif %}
        {% endif %}
      {% endif %}

      {% if setting('cloud_sms.sms_enabled') and (setting('cloud_sms.sms_live_play_one_day') == 'on' or setting('cloud_sms.sms_live_play_one_hour') == 'on') %}
        <div class="color-gray mtl">已有<span class="member-num">{{ notifyNum }}</span>人设置了提醒</div>
      {% endif %}
    </div>
  {% elseif ("now"|date("U")) > lesson.startTime and ("now"|date("U")) <= lesson.endTime %}
    <div class="mask-content">
      <h2>{{'直播已经开始，直播将于'|trans}}<span class="phm">{{ lesson.endTime|date('m') }}{{ '月'|trans }}{{ lesson.endTime|date('d') }}{{ '日'|trans }} {{ lesson.endTime|date('H:i') }}</span>{{'结束'|trans}}</h2>
      <a class="btn btn-info btn-lg mask-btn" href="{{ path('live_open_course_play',{courseId:course.id,lessonId:lesson.id, refererUrl:refererUrl})}}" target="_blank">{{'进入直播教室'|trans}}</a>
      
    </div>
  {% else %}
    <div class="mask-content">
      <h2>{{'直播已经结束'|trans}}</h2>
      {% if lesson.replayStatus == 'videoGenerated' %}
        <button class="btn btn-info btn-lg mask-btn live-video-replay-btn" data-referer="{{refererUrl}}">{{'查看回放'|trans}}</button>
      {% elseif lesson.replayStatus == 'generated' %}
        {% for replay in lesson.replays if replay %}
          <a class="btn btn-info btn-lg mask-btn" href="{{ path('live_open_course_live_replay_entry',{courseId:lesson.courseId,lessonId:lesson.id,replayId:replay.id, refererUrl:refererUrl}) }}" target="_blank">{{'查看回放'|trans}}</a>
        {% endfor %}
      {% else %}
        <p class="text-info">回放生成中，请稍候再来：）</p>
      {% endif %}
    </div>
  {% endif %}
  </div>
  {% if lesson.endTime < ("now"|date("U")) and lesson.replayStatus == 'videoGenerated' %}
    {% include 'TopxiaWebBundle:OpenCourse:lesson-play.html.twig' %}
  {% endif %}
{% endif %}